package com.fusion.minio.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.fusion.minio.properties.MinioProperties;
import io.minio.MinioClient;

@Configuration
public class MinioConfig {

	@Autowired
	private MinioProperties minioProperties;

	@Bean
	public MinioClient minioClient() throws Exception {
		String url = minioProperties.getUrl();
		String accessKey = minioProperties.getAccessKey();
		String secretKey = minioProperties.getSecretKey();
		return new MinioClient(url, accessKey, secretKey);
	}

}
